from neo4j import GraphDatabase

# 定义连接池配置
pool_config = {
    "max_connection_lifetime": 1800,  # 最大连接生命周期（秒）
    "max_connection_pool_size": 50,  # 最大连接池大小
    "connection_acquisition_timeout": 60  # 连接获取超时时间（秒）
}

# 创建连接池驱动程序
uri = "bolt://localhost:7687"
username = "neo4j"
password = "zxk1999"

driver = GraphDatabase.driver(uri, auth=(username, password),
                              max_connection_lifetime=pool_config["max_connection_lifetime"],
                              max_connection_pool_size=pool_config["max_connection_pool_size"],
                              connection_acquisition_timeout=pool_config["connection_acquisition_timeout"])
